22  Thevenin equivalent circuit

Last update: 20 June 2022

Abstract

22.1 Introduction

22.2 Circuit description

The Thevenin equivalent circuit is the reduction of a linear one port circuit to a single source and impedance and is based on Thevenin’s Theorem. This notebook describes solving problem 11.25, given in chapter 11 of Johnson, Hilburn, and Johnson (1978). The Python libraries of SimPy and Numpy are used to perform the math in the proposed solution. The problem asks the student to replace the circuit to the left of terminals a-b by its Thevenin equivalent and find V. The schematic was drawn using LTspice and the nodes were numbered. Terminals a-b are across the resistor R3. The circuit given in the textbook does not include a reference node, however the node at the bottom of the schematic was chosen as the reference node, ground.

Having drawn the circuit in LTspice, the following netlist was exported as a text file.

R1 2 0 6
R2 3 2 6
R3 0 3 6
L1 2 0 j2
L2 1 3 j3
C1 1 2 -j3
C2 3 0 -j2
I1 0 1 -1-j1

The component values for the inductors and capacitors are complex as well as the value of the current source. It is assumed that the impedance of the inductors and capacitors are at a frequency of 1 radian per second. So accordingly, the values in the net list used by the Python code to generate the network equations has been adjusted as follows:

R1 2 0 6
R2 3 2 6
R3 0 3 6
L1 2 0 2
L2 1 3 3
C1 1 2 0.33
C2 3 0 0.5
I1 0 1 1

The component values are not used when the symbolic network equations are generated, only the reference designators, R1, C1, L1 etc. are used.

from sympy import *
import numpy as np
init_printing()

22.3 Find the open circuit voltage, Voc

Removing R3 and C2 from the netlist, this gives Voc = V3. The net list is:

I1 0 1 1
R1 2 0 6
R2 3 2 6
*R3 0 3 6
L1 2 0 2
L2 1 3 3
C1 1 2 0.33
*C2 3 0 0.5

Network equations generated by the MNA code are:

[[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
[Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1) - v3/R2, 0)],
[Eq(-I_L2 - v2/R2 + v3/R2, 0)],
[Eq(-I_L1*L1*s + v2, 0)],
[Eq(-I_L2*L2*s + v1 - v3, 0)]])

The following Python code declares the symbols and equations.

# declare the following symbols
I_L1, s, C1, I1, R2, R1, v3, v1, I_L2, L1, v2, L2 = symbols('I_L1 s C1 I1 R2 R1 v3 v1 I_L2 L1 v2 L2')

# use the equations generated by nodal analysis
equ = Matrix(
    [[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
    [Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1) - v3/R2, 0)],
    [Eq(-I_L2 - v2/R2 + v3/R2, 0)],
    [Eq(-I_L1*L1*s + v2, 0)],
    [Eq(-I_L2*L2*s + v1 - v3, 0)]]) 
    
equ

\[\left[\begin{matrix}C_{1} s v_{1} - C_{1} s v_{2} + I_{L2} = I_{1}\\- C_{1} s v_{1} + I_{L1} + v_{2} \left(C_{1} s + \frac{1}{R_{2}} + \frac{1}{R_{1}}\right) - \frac{v_{3}}{R_{2}} = 0\\- I_{L2} - \frac{v_{2}}{R_{2}} + \frac{v_{3}}{R_{2}} = 0\\- I_{L1} L_{1} s + v_{2} = 0\\- I_{L2} L_{2} s + v_{1} - v_{3} = 0\end{matrix}\right]\]

The symbolic solution for the network equations can easily be obtained with SymPy using the solve function. Using the index [v3], the open circuit voltage at node 3 in symbolic form is:

solve(equ,[v1, v2, v3, I_L1, I_L2])[v3]

\[\frac{I_{1} \left(C_{1} L_{1} L_{2} R_{1} s^{3} + C_{1} L_{1} R_{1} R_{2} s^{2} + L_{1} R_{1} s + L_{1} R_{2} s + R_{1} R_{2}\right)}{C_{1} L_{1} L_{2} s^{3} + C_{1} L_{1} R_{2} s^{2} + C_{1} L_{2} R_{1} s^{2} + C_{1} R_{1} R_{2} s + L_{1} s + R_{1}}\]

To solve numerically, replace symbols with the element values and the Laplace variable, s, with \(j\omega\) where \(\omega=1\).

equ1a = equ.subs({L1:2, L2:3, R1:6, R2:6, C1:1/3, I1:-1-1j, s:1j})
equ1a  # display the equations

\[\left[\begin{matrix}I_{L2} + 0.333333333333333 i v_{1} - 0.333333333333333 i v_{2} = -1.0 - 1.0 i\\I_{L1} - 0.333333333333333 i v_{1} + v_{2} \left(\frac{1}{3} + 0.333333333333333 i\right) - \frac{v_{3}}{6} = 0\\- I_{L2} - \frac{v_{2}}{6} + \frac{v_{3}}{6} = 0\\- 2.0 i I_{L1} + v_{2} = 0\\- 3.0 i I_{L2} + v_{1} - v_{3} = 0\end{matrix}\right]\]

Solving the system of equations for the open circuit voltage at node v3.

Voc = solve(equ1a,[v1, v2, v3, I_L1, I_L2])[v3]
Voc

\[-1.8 + 0.6 i\]

22.4 Find the short circuit current, Isc

Remove C2 and R3, set node 3 to zero, find current in L2 and R2. New net list:

I1 0 1 1
R1 2 0 6
R2 0 2 6
L1 2 0 2
L2 1 0 3
C1 1 2 0.33

Equations generated

[[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
[Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1), 0)],
[Eq(-I_L1*L1*s + v2, 0)],
[Eq(-I_L2*L2*s + v1, 0)]]
L2, L1, v1, R1, I_L1, R2, s, I_L2, v2, I1, C1 = symbols('L2 L1 v1 R1 I_L1 R2 s I_L2 v2 I1 C1')

equ = Matrix(
    [[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
    [Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1), 0)],
    [Eq(-I_L1*L1*s + v2, 0)],
    [Eq(-I_L2*L2*s + v1, 0)]])    
    
equ

\[\left[\begin{matrix}C_{1} s v_{1} - C_{1} s v_{2} + I_{L2} = I_{1}\\- C_{1} s v_{1} + I_{L1} + v_{2} \left(C_{1} s + \frac{1}{R_{2}} + \frac{1}{R_{1}}\right) = 0\\- I_{L1} L_{1} s + v_{2} = 0\\- I_{L2} L_{2} s + v_{1} = 0\end{matrix}\right]\]

A symbolic solution for the circuit current in L2 and R2:

u = solve(equ,[v1, v2, I_L1, I_L2])
u[v2]/R2 + u[I_L2]

\[\frac{C_{1} I_{1} L_{1} L_{2} R_{1} s^{3}}{C_{1} L_{1} L_{2} R_{1} s^{3} + C_{1} L_{1} L_{2} R_{2} s^{3} + C_{1} L_{1} R_{1} R_{2} s^{2} + C_{1} L_{2} R_{1} R_{2} s^{2} + L_{1} R_{1} s + L_{1} R_{2} s + R_{1} R_{2}} + \frac{I_{1} \left(L_{1} s \left(C_{1} R_{1} R_{2} s + R_{1} + R_{2}\right) + R_{1} R_{2}\right)}{- C_{1}^{2} L_{1} L_{2} R_{1} R_{2} s^{4} + C_{1} L_{1} L_{2} s^{3} \left(C_{1} R_{1} R_{2} s + R_{1} + R_{2}\right) + C_{1} L_{2} R_{1} R_{2} s^{2} + L_{1} s \left(C_{1} R_{1} R_{2} s + R_{1} + R_{2}\right) + R_{1} R_{2}}\]

To solve numerically, enter the element values.

equ1a = equ.subs({L1:2, L2:3, R1:6, R2:6, C1:1/3, I1:-1-1j, s:1j})
equ1a  # display the equations

\[\left[\begin{matrix}I_{L2} + 0.333333333333333 i v_{1} - 0.333333333333333 i v_{2} = -1.0 - 1.0 i\\I_{L1} - 0.333333333333333 i v_{1} + v_{2} \left(\frac{1}{3} + 0.333333333333333 i\right) = 0\\- 2.0 i I_{L1} + v_{2} = 0\\- 3.0 i I_{L2} + v_{1} = 0\end{matrix}\right]\]

Solve the system of equations.

u1 = solve(equ1a,[v1, v2, v3, I_L1, I_L2])
u1

\[\left \{ I_{L1} : -1.5 - 1.5 i, \quad I_{L2} : -0.5 + 1.5 i, \quad v_{1} : -4.5 - 1.5 i, \quad v_{2} : 3.0 - 3.0 i\right \}\]

Current in I_R2 = V2/R2

Isc = u1[v2]/6 + u1[I_L2]
Isc

\[1.0 i\]

Zth = simplify(Voc/Isc)
Zth

\[0.6 + 1.8 i\]

Voc along with Zth are the values to the Thevenin equivalent circuit.

22.5 Find V3 using the Thevenin equivalent circuit

The load attached to the Thevenin equivalent circuit is the parallel of the resistor and capacitor.
\(Z = \frac{1}{\frac{1}{R}+\frac{1}{C}}\)
The load \(Z\) is the parallel combination of R = 6 and C = -j2.

Z = (1)/(1/(6)+1/(-2j))
Z
(0.6-1.7999999999999998j)

Using the values for \(V_{oc}\) and \(Z_{th}\) obtained above, we write the equation for V3 as a voltage divider and have SymPy simplify the result.

simplify(Z*Voc/(Zth+Z))

\[4.62592926927148 \cdot 10^{-16} + 3.0 i\]

We can get SymPy to ignore small numbers by using the round function set to 3 digits.

simplify(Z*Voc/(Zth+Z)).round(3)

\[3.0 i\]

22.6 Find V3 using the complete circuit

Checking the answer for V3, by solving the equations for the complete circuit. The net list is:

I1 0 1 1
R1 2 0 6
R2 3 2 6
R3 0 3 6
L1 2 0 2
L2 1 3 3
C1 1 2 0.33
C2 3 0 0.5

Equations generated are:

[[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
[Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1) - v3/R2, 0)],
[Eq(-I_L2 + v3*(C2*s + 1/R3 + 1/R2) - v2/R2, 0)],
[Eq(-I_L1*L1*s + v2, 0)],
[Eq(-I_L2*L2*s + v1 - v3, 0)]]

Declare the symbols and equations for the complete circuit.

R3, C2, L2, L1, v1, R1, I_L1, R2, s, I_L2, v3, v2, I1, C1 = symbols('R3 C2 L2 L1 v1 R1 I_L1 R2 s I_L2 v3 v2 I1 C1')

equ = Matrix(
    [[Eq(C1*s*v1 - C1*s*v2 + I_L2, I1)],
    [Eq(-C1*s*v1 + I_L1 + v2*(C1*s + 1/R2 + 1/R1) - v3/R2, 0)],
    [Eq(-I_L2 + v3*(C2*s + 1/R3 + 1/R2) - v2/R2, 0)],
    [Eq(-I_L1*L1*s + v2, 0)],
    [Eq(-I_L2*L2*s + v1 - v3, 0)]])
equ # display the equations

\[\left[\begin{matrix}C_{1} s v_{1} - C_{1} s v_{2} + I_{L2} = I_{1}\\- C_{1} s v_{1} + I_{L1} + v_{2} \left(C_{1} s + \frac{1}{R_{2}} + \frac{1}{R_{1}}\right) - \frac{v_{3}}{R_{2}} = 0\\- I_{L2} + v_{3} \left(C_{2} s + \frac{1}{R_{3}} + \frac{1}{R_{2}}\right) - \frac{v_{2}}{R_{2}} = 0\\- I_{L1} L_{1} s + v_{2} = 0\\- I_{L2} L_{2} s + v_{1} - v_{3} = 0\end{matrix}\right]\]

Solving for v3 using the symbolic values

solve(equ,[v1, v2, v3, I_L1, I_L2])[v3]

\[\frac{I_{1} R_{3} \left(C_{1} L_{1} L_{2} R_{1} s^{3} + C_{1} L_{1} R_{1} R_{2} s^{2} + L_{1} R_{1} s + L_{1} R_{2} s + R_{1} R_{2}\right)}{C_{1} C_{2} L_{1} L_{2} R_{1} R_{3} s^{4} + C_{1} C_{2} L_{1} L_{2} R_{2} R_{3} s^{4} + C_{1} C_{2} L_{1} R_{1} R_{2} R_{3} s^{3} + C_{1} C_{2} L_{2} R_{1} R_{2} R_{3} s^{3} + C_{1} L_{1} L_{2} R_{1} s^{3} + C_{1} L_{1} L_{2} R_{2} s^{3} + C_{1} L_{1} L_{2} R_{3} s^{3} + C_{1} L_{1} R_{1} R_{2} s^{2} + C_{1} L_{1} R_{2} R_{3} s^{2} + C_{1} L_{2} R_{1} R_{2} s^{2} + C_{1} L_{2} R_{1} R_{3} s^{2} + C_{1} R_{1} R_{2} R_{3} s + C_{2} L_{1} R_{1} R_{3} s^{2} + C_{2} L_{1} R_{2} R_{3} s^{2} + C_{2} R_{1} R_{2} R_{3} s + L_{1} R_{1} s + L_{1} R_{2} s + L_{1} R_{3} s + R_{1} R_{2} + R_{1} R_{3}}\]

Inserting the element values into the equations.

equ1a = equ.subs({L1:2, L2:3, R1:6, R2:6, R3:6, C1:1/3, C2:1/2, I1:-1-1j, s:1j})
equ1a  # display the equations

\[\left[\begin{matrix}I_{L2} + 0.333333333333333 i v_{1} - 0.333333333333333 i v_{2} = -1.0 - 1.0 i\\I_{L1} - 0.333333333333333 i v_{1} + v_{2} \left(\frac{1}{3} + 0.333333333333333 i\right) - \frac{v_{3}}{6} = 0\\- I_{L2} - \frac{v_{2}}{6} + v_{3} \left(\frac{1}{3} + 0.5 i\right) = 0\\- 2.0 i I_{L1} + v_{2} = 0\\- 3.0 i I_{L2} + v_{1} - v_{3} = 0\end{matrix}\right]\]

Solving the system of equations for v3 using the SymPy solve function.

solve(equ1a,[v1, v2, v3, I_L1, I_L2])[v3]

\[3.0 i\]

The value obtained by solving the system equations for the complete network agrees with the Thevenin equivalent circuit solution.

22.7 References

  1. Basic Electric Circuit Analysis, D. E. Johnson, J. L. Hilburn, and J. R. Johnson, Prentice-Hall, 1978
  2. https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html